﻿//////////////////////////////////////////////////////////////////
//
// WorldArchive.cs
//
// Copyright (c) 2012 Dan Pike. All rights reserved
//
// Refer to license.txt for any license restrictions.
// 
using Logger4Net;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

////////////////////////////////////////////////////////////////////////
//
namespace Entities.Archive
{
   ////////////////////////////////////////////////////////////////////////
   //
   public class WorldArchive : Utilities.Archive
   {
      public static readonly string CONFIG_SECTION = "world";

      ////////////////////////////////////////////////////////////////////////
      //
      public WorldArchive()
      {
         try
         {
            Properties.Add(cities_);
            cities = new Cities();
            Properties.Add(convoys_);
            convoys = new Convoys();
         }
         catch (System.Exception ex)
         {
            logger_.exception(ex);
         }
      }

      ////////////////////////////////////////////////////////////////////////
      //
      [ConfigurationProperty("cities")]
      public Cities cities
      {
         get { return (Cities)base[cities_]; }
         set { base[cities_] = value; }
      }

      ////////////////////////////////////////////////////////////////////////
      //
      [ConfigurationProperty("convoys")]
      public Convoys convoys
      {
         get { return (Convoys)base[convoys_]; }
         set { base[convoys_] = value; }
      }

      ////////////////////////////////////////////////////////////////////////
      //
      private ConfigurationProperty cities_ = new ConfigurationProperty("cities", typeof(Cities), null);
      private ConfigurationProperty convoys_ = new ConfigurationProperty("convoys", typeof(Convoys), null);
   }
}
